﻿@using PagedList
@using PagedList.Mvc
@model IPagedList<Project_2._2.ViewModels.CarList_ViewModel>

@{
    ViewBag.Title = "DanhSachDichVu";
    Layout = "~/Views/Shared/_UserLayoutPage2.cshtml";
}


@* ToolTip *@
<script type="text/javascript">

    function dotooltip(hinh) {
        document.getElementById("hinh").src = hinh;
        document.getElementById("ToolTip").style.visibility = "visible";
    };
    document.onmousemove = function (e) {
        if (e == null)//neu la IE hoac chrome
        {
            mx = event.pageX;
            my = event.pageY;
        }
        else // firefox hoac operrator
        {
            mx = e.clientX;
            my = e.clientY;
        }
        div_tt = document.getElementById("ToolTip").style;
        if (mx > 880)
        { div_tt.left = (mx - 460) + "px"; }
        else
        { div_tt.left = (mx + 10) + "px"; }
        if (my > 300)
            div_tt.top = (my - 300) + "px";
        else
            div_tt.top = (my - 100) + "px";
    }
    function hide() {
        document.getElementById("ToolTip").style.visibility = "hidden";
    };
</script>
<!-- ToolTip san pham --->
<div id="ToolTip" style="width:auto ; height:auto; border:2px solid red; position:fixed; z-index:999; border-radius:10px; visibility:hidden">
    <img id="hinh" width="450" />
</div>
@*  end ToolTip   *@


<div class="ContentLeft-child">
    <div class="ContentRight-child-head"> @ViewBag.tieude</div>
    <div class="ContentRight-child-logo"></div>
    <div class="ContentRight-child-body Box_sp">
        @Html.Raw( ViewBag.str)
        @*@if (Model != null || Model.Count > 0)
        {
                for (int j = 0; j < Model.Count; j++)
                {
                     if( j % 2 == 0)
                     {
                        <div class="sp">
                            <div class="sp_name">@Model[j].name</div>
                            <div>
                                <div>
                                    <img src="~/Images/Cars/@Model[j].hinh" style="cursor:pointer" width="160" height="110" onmouseover="dotooltip('../Images/Cars/@Model[j].hinh')" onmouseout="hide()" />
                                </div>
                                <div class="sp_detail">
                                    Hiệu : @Model[j].THieu<br />
                                    Dòng xe: Civic<br />
                                    Đời xe : @Model[j].DoiXe <br />
                                    Kiểu xe : @Model[j].Loai<br />
                                    Màu xe : @Model[j].Color<br />
                                    Giá thuê tháng :<span> @string.Format("{0:#,### đ}", Model[j].Gia)</span><br />

                                </div>
                                <div style="clear:right"></div>
                                <div style="text-align:center; margin-bottom:10px">
                                    <input type="button" value="Đặt Xe" class="Button" style=" margin-top:5px" />
                                    <a href="@Url.Action("ChiTiet", "Xe", new {  id = Model[j].id})" style="font-size:13px; text-decoration:none; padding-top:5px" class="Button">Xem Chi tiết</a>
                                </div>
                            </div>
                        </div>
                     }
                    else
                     {
                        <div class="sp-left">
                            <div class="sp_name">@Model[j].name</div>
                            <div>
                                <div>
                                    <img src="~/Images/Cars/@Model[j].hinh" style="cursor:pointer" width="160" height="110" onmouseover="dotooltip('../Images/Cars/@Model[j].hinh')" onmouseout="    hide()" />
                                </div>
                                <div class="sp_detail">
                                    Hiệu : @Model[j].THieu<br />
                                    Dòng xe: Civic<br />
                                    Đời xe : @Model[j].DoiXe <br />
                                    Kiểu xe : @Model[j].Loai<br />
                                    Màu xe : @Model[j].Color<br />
                                    Giá thuê tháng :<span> @string.Format("{0:#,### đ}", Model[j].Gia)</span><br />

                                </div>
                                <div style="clear:right"></div>
                                <div style="text-align:center; margin-bottom:10px">
                                    <input type="button" value="Đặt Xe" class="Button" style=" margin-top:5px" />
                                    <a href="@Url.Action("ChiTiet", "Xe", new {  id = Model[j].id})" style="font-size:13px; text-decoration:none; margin-top:5px" class="Button">Xem Chi tiết</a>
                                </div>
                            </div>
                        </div>
                        <div style="clear:both"></div>
                    }
                }
        }*@
    </div>
</div>
